home *** CD-ROM | disk | FTP | other *** search
Wrap
XSetup plugin | 2002-04-17 | 2.9 KB | 115 lines
"FILE"="Xteq Systems X-Setup Plugin 5.0" "TYPE"="5" "COUNT"="2" "UIPATH"="Internet\Windows Media Player" "NAME"="Clear Cache" "VERSION"="1.00" "WARNING"="1" "LANGUAGE"="VBScript" "TEXT 1"="Clear WMP Cache" "TEXT 2"="Clear WMP Cache (total erase!)" "DESCRIPTION 1"="This plug-in will totally erase the entire cache of Windows Media Player." "DESCRIPTION 2"="If you select to open the second option, the cache will be filled with garbage before deleting it, so it very hard to reproduce the contents of cache file." "DESCRIPTION 3"="IMPORTANT! Close Windows Media Player before using any of these functions!" "AUTHOR"="Xteq Systems" "CONTACTURL"="http://www.xteq.com" "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved" "COMMENT 1"="Setting found at Windows XP FAQ" sP="HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common AppData" sAdd="\Microsoft\Media Index\wmplibrary_v_0_12.db" Sub Plugin_Initialize End Sub Sub Plugin_CheckData(ElementIndex) End Sub Sub Plugin_Apply(ElementIndex,ElementSubIndex) if ElementIndex=1 then Call DoWork(false) else Call DoWork(true) end if End Sub Sub DoWork(EraseTotally) s=RegReadValue(sP) sFile=s & sAdd if fileexists(sFile) then if EraseTotally then lC=TxtOpen(sFile) 'replace contents of file for l=1 to lC Call TxtSetLine(l,"-") next 'desktop.ini is special case.. if right(sFile,11)="desktop.ini" then Call FileSetAttribute(sFile,"R-") Call FileSetAttribute(sFile,"H-") Call FileSetAttribute(sFile,"S-") end if Call TxtSave() end if 'now kill the file FileDelete(sFile) Call MsgInformation("Cache has been cleared") else msgerror "Unable to locate WMP Cache - the file " & sFile & " can not be found." end if end Sub Sub KillDir(DirName,EraseTotally,KillDirAlso) iC=FileEnum(DirName & "*.*") for i=1 to iC sFile=FileEnumElement(i) 'index.dat can not be earased, always locked for writing... grr.. if lcase(right(sFile,9))<>"index.dat" then if EraseTotally then lC=TxtOpen(sFile) 'replace contents of file for l=1 to lC Call TxtSetLine(l,"-") next 'desktop.ini is special case.. if right(sFile,11)="desktop.ini" then Call FileSetAttribute(sFile,"R-") Call FileSetAttribute(sFile,"H-") Call FileSetAttribute(sFile,"S-") end if Call TxtSave() end if 'now kill the file FileDelete(sFile) end if next if KillDirAlso=true then FolderDelete(DirName) end if End Sub Sub Plugin_Terminate End Sub